package com.jiazhong.shixi.bean.controller;

import com.jiazhong.shixi.bean.bean.ShoppingCart;
import com.jiazhong.shixi.bean.mapper.ShoppingCartMapper;
import com.jiazhong.shixi.bean.util.JsonResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("/shopping_cart")
@RestController
public class ShoppingCartController {

    @Resource
    private ShoppingCartMapper shoppingCartMapper;

    @RequestMapping("/find")
     public JsonResult findByUserId(String user_id) {
        List<ShoppingCart> list = shoppingCartMapper.findByUserId(user_id);
        JsonResult result = new JsonResult(true,200,list,"");
        return result;
    }
}
